package com.modules.login;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.base.mvp.MvpFragment;
import com.modules.bean.User;

/**
 * Created by gml on 17/2/23.
 */

public class MainFragment extends MvpFragment<LoginContract.View, LoginPresenter> implements  LoginContract.View {


    //通过 dagger 提供 初始化
//    @Inject //发出信号 要求提供支援 提供 对象
//            LoginPresenter mainPresenter;


    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

//        DaggerMainActivityComponent.builder()
//                .appComponent(AppApplication.get(getActivity()).getAppComponent())
////                .mainModule(new MainModule(this))
//                .build()
//                .injectMainFragment(this);
//        AppApplication.get(getActivity()).getAppComponent().inject(this);
    }





    @Override
    protected int getViewLayoutId() {
        return 0;
    }

    @Override
    protected void initView(View v) {
        super.initView(v);
        mPresenter.login("15901222696", "qqqqqqqq");
    }

    /**
     * 请求 成功页面处理
     */
    @Override
    public void loginSucc(User user) {

        System.out.println("----------------loginSucc");
    }



    @Override
    public void registSucc(User user) {
        System.out.println("----------------registSucc");
    }

}
